Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass new session as extra param to Session reload and regenerate callbacks #907

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sgpinkus
Copy link

Why? The scope calling regenerate (or reload) does not necessarily want or need to know what a req is. Passing the new session object as a callback parameter allows the callback to regenerate or resave then make changes without knowing about req. Example:

  session.regenerate((err, newSession) => {
    if(err) return next(err);
    session.justRegenerated = true;  // Just an example.
  });

I specifically wanted this to Session.regenerate but added to Session.reload too for consistency. Might also want it in Session.save callback but that seems to require change in the behaviour of plugins so I gave it a pass.

@sgpinkus
Copy link
Author

@import-brain, @dougwilson Any chance merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants